<template>
  <div class="err_wrap">
    <!-- <h1 class="error" v-if="error.statusCode === 404">
        页面不存在或没有数据
      </h1>
      <h1 class="error" v-else>应用出现了点意外，请重试~ {{ error }}</h1>
      <nuxt-link class="to_home" to="/">返回首页</nuxt-link> -->

      <div class="err-bg">
        <div v-if="error.statusCode === 404" class="error-message">404</div>
        <div v-else class="error-message">
          {{ error.message || error }}
        </div>
        <div>
          <el-button class="back-home" @click="handleBackHome">back to home</el-button>
        </div>
      </div>
  </div>
</template>

<script>
export default {
  props: ["error"],
  layout: "detail",
  data() {
    console.log(this.error);
    return {
      msg: "未找到相应页面或没有数据",
    };
  },
  methods: {
    handleBackHome() {
      this.$router.replace("/")
    }
  }
};
</script>

<style scoped lang="scss">
.err_wrap {
  width: 100%;

  .err-bg{
    min-height: 994px;
    width: 100%;
    background-repeat: no-repeat;
    background-size: cover;
    text-align: center;

    .error-404{
      margin: 0 auto;
      margin-top: 135px;
      width: 400px;
      height: auto;
    }

    .back-home{
      width: 168px;
      height: 46px;
      border-radius: 4px;
      border: 1px solid #182E59;
      background: transparent;
      font-size: 18px;
      font-family: PingFangSC-Regular, PingFang SC;
      font-weight: 400;
      color: #182E59;
      margin-top: 36px;
    }

    .error-message{
      height: 200px;
      line-height: 200px;
      color: rgb(133, 0, 0);
      font-size: 30px;
      font-weight: bold;
    }
  }
}

</style>
